﻿namespace EyeOpen.OopByTdd.Math
{
	public class MultiplyOperation 
		: ArithmeticOperation
	{
		public override int Operation(int operand1, int operand2)
		{
			var temp = 0;

			var i = operand2;

			while (i > 0)
			{
				temp = Sum(operand1, temp);

				i--;
			}

			return temp;
		}

		protected virtual int Sum(int a, int b)
		{
			return a + b;
		}
	}
}